package view;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.SwingConstants;

import model.Simulator;

public class StatisticsView extends AbstractView 
{
	// Object ID
	private static final long serialVersionUID = 4223766039164707711L;

	// Label to show the amount of steps
	public JLabel overviewLabel;
	public JLabel stepLabel;
	public JLabel hunterLabel;
	public JLabel foxLabel;
	public JLabel redFoxLabel;
	public JLabel rabbitLabel;
	public JLabel totalLabel;
	public JLabel grassLabel;
	
	public StatisticsView(Simulator simulator) 
	{
		// AbstractView
		super(simulator);
		
		// Build the view
		createView();
	}
	
	@Override
	protected void createView()
	{
		setLayout(null);
		
		// Overview label
		overviewLabel = new JLabel("Overzicht");
		overviewLabel.setFont(new Font("Tahoma", Font.BOLD, 12));
		overviewLabel.setBounds(25, 5, 100, 25);
		add(overviewLabel);
		
		// Steps label
		stepLabel = new JLabel("Step: ");
		stepLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		stepLabel.setBounds(10, 40, 100, 15);
		add(stepLabel);
		
		// Hunters label
		hunterLabel = new JLabel("Hunters: ");
		hunterLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		hunterLabel.setBounds(10, 60, 100, 15);
		add(hunterLabel);
		
		// Hunters label
		foxLabel = new JLabel("Foxes: ");
		foxLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		foxLabel.setBounds(10, 80, 100, 15);
		add(foxLabel);
		
		// Hunters label
		redFoxLabel = new JLabel("Red Foxes: ");
		redFoxLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		redFoxLabel.setBounds(10, 100, 100, 15);
		add(redFoxLabel);
		
		// Hunters label
		rabbitLabel = new JLabel("Rabbits: ");
		rabbitLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		rabbitLabel.setBounds(10, 120, 100, 15);
		add(rabbitLabel);

		// Grass label
		grassLabel = new JLabel("Grass: ");
		grassLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		grassLabel.setBounds(10, 140, 100, 15);
		add(grassLabel);
		
		// Total label
		totalLabel = new JLabel("Total: ");
		totalLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		totalLabel.setBounds(10, 160, 100, 15);
		add(totalLabel);
	}
	
	@Override
	public void updateView()
	{
        simulator.stats.getPopulationDetails2(simulator.getField(), this);
	}

}
